package com.spn.blog.api.controller.system;

import com.spn.blog.common.vo.Result;
import com.spn.blog.service.login.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "系统模块")
@RestController
@RequestMapping("api/logout")
public class LogoutController {

    @DubboReference(check = false)
    private LoginService loginService;

    @ApiOperation(value = "用户退出登录")
    @GetMapping
    public Result logout(@RequestHeader("Authorization") String token){
        //登录  验证用户，访问用户表(不引入SysUserService，因为每个业务对应自己的Service)
        return loginService.logout(token);
    }
}
